/**
 * 处理一些鼠标事件的函数
 */
let mouseListener = {
  /**
   * 判断feature 类型
   * @param {*} feature
   * @returns name
   */
  typeJudge(feature) {
    if (feature.get('typhoonPoint')) {
      return 'typhoonPoint'
    } else if (feature.get('typhoonSolar')) {
      return 'typhoonSolar'
    } else {
      return 'isFeatureButDontNeedTodo'
    }
  },

  /**
   * 台风特征点 通过typeJudeg 拼接 鼠标事件名称来调用不同鼠标方法
   */
  typhoonPointClick(feature) {
    console.log('you click => typhoonPoint !')
  },
  typhoonPointHover(feature) {
    this.map.getTargetElement().style.cursor = 'pointer'
    this.handleDeletePointZoom()
    feature.getStyle().getImage().setRadius(8)
    feature.changed()
    this.lastZoomPoint = feature
  },

  /**
   * 台风风圈
   */
  typhoonSolarClick(feature) {
    console.log('风圈被click')
  },
  typhoonSolarHover(feature) {
    console.log('风圈被hover')
  },

  /**
   * 如果是特征但不需要处理执行
   */
  isFeatureButDontNeedTodoClick() {
    return
  },
  isFeatureButDontNeedTodoHover() {
    console.log('-> feature Hover')
  }
}

export default mouseListener
